package com.lf.web.config;

import com.lf.web.WebConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * 此配置相当于web.xml此种方法用于指定配置类
 * Created by LF on 2017/5/4.
 */
public class MyJavaConfigDispatcherServlet extends AbstractAnnotationConfigDispatcherServletInitializer {


    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{WebConfig.class};//指定配置类
    }

    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};//请求映射
    }
}
